<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@page import="cn.rjtraining.util.DbUtil"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!-- author:刘健 -->

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<base href="<%=basePath%>">
		<title>学生成绩管理</title>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<link href="../theme/list.css" rel="stylesheet" type="text/css" />
		<script type="text/javascript" src="../js/calendar.js">
</script>
	</head>

	<body>
		<center>
			<form action="admin/score_search" method="post">
				<table bgcolor="#EFF3F7" width="100%" border=0 align=center
					cellpadding=0 cellspacing=0 bordercolor=#ffffff
					style="FONT-SIZE: 10pt">
					<tr>
						<td align="center" colspan="4">
							<h2>
								学生成绩录入
							</h2>
						</td>
					</tr>
					<tr>
						<td>

							&nbsp; 学生所在班级：
							<select name="clname">
								<%
									String sql = "select distinct classes from student";
									List<String> classesLists = DbUtil.query(sql);
									for (String s : classesLists) {
								%>
								<option>
									<%=s%>
								</option>
								<%
									}
								%>
							</select>
							&nbsp; 课程名称：
							<select name="coname">
								<%
									sql = "select distinct coname from course";
									classesLists = DbUtil.query(sql);
									for (String s : classesLists) {
								%>
								<option>
									<%=s%>
								</option>
								<%
									}
								%>
							</select>
							<%--
							考试时间：
							<input type="text" style="width: 100px;"
								onClick="fPopCalendar(event,this,this);"
								onFocus="this.select();" />
							--%>
							&nbsp;
							<input type="submit" value="查询" />
						</td>
					</tr>
				</table>
			</form>
			<table width="100%" border=0 align=center cellpadding=0 cellspacing=0
				bordercolor=#ffffff style="FONT-SIZE: 10pt">
				<tr>
					<td height=28 align=right valign="center" nowrap="nowrap"
						background="../images/list_middle.jpg">
						&nbsp;
					</td>
				</tr>
			</table>
			<table width="100%" border="0" cellPadding="0" cellSpacing="1"
				bgcolor="#6386d6">
				<!-- 列表标题栏 -->
				<tr bgcolor="#EFF3F7">
					<td width="15%" height="37" align="center">
						<b>学号</b>
					</td>
					<td width="15%" height="37" align="center">
						<b>姓名</b>
					</td>
					<td width="25%" height="37" align="center">
						<b>考试开始时间</b>
					</td>
					<td width="15%" height="37" align="center">
						<b>考试结束时间</b>
					</td>
					<td width="15%" height="37" align="center">
						<b>课程名称</b>
					</td>
					<td width="15%" height="37" align="center">
						<b>成绩</b>
					</td>
				</tr>
				<!-- 列表数据栏 -->
				<c:forEach var="c" items="${scores}">
					<form action="admin/score_add" method="post">
						<tr bgcolor="#EFF3F7" onMouseOver="this.bgColor = '#DEE7FF';"
							onMouseOut="this.bgColor='#EFF3F7';">
							<td align="center" vAlign="center">
								<input type="hidden" name="sno" value="${c.sno}" />
								${c.sno}
							</td>
							<td align="center" vAlign="center">
								<input type="hidden" name="sname" value="${c.sname}" />
								<a href="#">${c.sname}</a>
							</td>
							<td align="center" vAlign="center">
								<input type="hidden" name="exam_start_time"
									value="${c.exam_start_time}" />
								${c.exam_start_time}
							</td>
							<td align="center" vAlign="center">
								<input type="hidden" name="exam_end_time"
									value="${c.exam_end_time}" />
								${c.exam_end_time}
							</td>
							<td align="center" vAlign="center">
								<input type="hidden" name="coname" value="${c.coname}" />
								${c.coname}
							</td>
							<td align="center" vAlign="center">
								<input type="text" style="width: 100px;" name="score" />
								<input type="submit" value="提交" />
							</td>
						</tr>
					</form>
				</c:forEach>
				<tr bgcolor="#EFF3F7" onMouseOver="this.bgColor = '#DEE7FF';"
					onMouseOut="this.bgColor='#EFF3F7';">
					<td colspan="5" align="center">
						${msg}
					</td>
					<td colspan="1" align="right">
						<input type="button" value="批量提交" />
					</td>
				</tr>
			</table>

			<!-- 在列表数据为空的时候，要显示的提示信息 -->
			<table height="30" width="100%" border=0 align=center cellpadding=0
				cellspacing=0 bordercolor=#ffffff style="FONT-SIZE: 14pt">
				<tr>
					<td align=right valign="center" nowrap="nowrap"
						background="../images/list_middle.jpg">
						<label style="color: blue;">
							共有
							<span>500</span>条记录,
							<span>50</span>页&nbsp;&nbsp;&nbsp;
						</label>
						<a href="#">首页</a>
						<a href="#">1</a>
						<a href="#"> 2 </a>
						<a href="#"> 3 </a>
						<a href="#"> 4 </a>
						<a href="#"> 5 </a>
						<a href="#">下一页</a>
						<a href="#">末页</a> &nbsp;&nbsp;&nbsp; 跳转到第
						<input type="text" style="width: 30px; height: 25px" />
						页
						<input type="button" style="height: 25px" value="Go" />
					</td>
				</tr>
			</table>
		</center>
	</body>
</html>
